#include <bits/stdc++.h>
using namespace std;

#define ONLINE_JUDGE

#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

typedef long long LL;

const int N = 2e5+50;

int q;
int n;
char s[N];

vector<int> pos[30];

int main(int argc, char const *argv[])
{
	scanf("%s", s);
	n = strlen(s);
	for (int i=0; i<n; ++i)
	{
		pos[s[i]-'a'].push_back(i);
	}
	scanf("%d", &q);

	for (int kk=0; kk<q; ++kk)
	{
		int l, r; scanf("%d%d", &l, &r);
		--l; --r;
		if (l == r || s[l] != s[r])
		{
			puts("Yes");
			continue;
		}
		
		// ++r;
		int ms = 0, cnt = 0;
		for (int i=0; i<26 && cnt<=2; ++i)
		{
			auto p1 = lower_bound(pos[i].begin(), pos[i].end(), l), p2 = upper_bound(pos[i].begin(), pos[i].end(), r);
			if (p1 == p2) continue;
			++cnt;
		}
		if (cnt <= 2) puts("No");
		else puts("Yes");
	}
	return 0;
}